package com.isoft.service.tableservice;

import com.isoft.dao.tabledao.DfmeArreDao;
import com.isoft.entity.tableentity.dfme_arre.DfmeArreMsg;
import com.isoft.utils.TimeFormatUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.text.ParseException;

@Service
public class DfmeArreService {

    @Autowired
    private DfmeArreDao dfmeArreDao;

    /**
     *
     * 向数据库插入数据的方法
     */

    public int insertmsg(DfmeArreMsg dfmeArreMsg) throws ParseException {
        Timestamp create_time = TimeFormatUtils.GetNowTime();
        Timestamp ddtm = TimeFormatUtils.stringToTimestamp(dfmeArreMsg.getDfmeArreMeta().getDdtm());
        Timestamp frlt = TimeFormatUtils.stringToTimestamp(dfmeArreMsg.getDflt().getFrlt());
        dfmeArreDao.insertMeta(create_time,ddtm,dfmeArreMsg.getDfmeArreMeta());
        return dfmeArreDao.insertDflt(dfmeArreMsg.getDfmeArreMeta().getSeqn(),create_time,dfmeArreMsg.getDflt(),frlt);
}



}
